import Vue from 'vue'
import router from './router'
import App from './App.vue'
import store from './components/store/index.js'
import './permisssion.js'

//element引入
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

//导入全局样式表
import './assets/css/global.css'

//
import TreeTable from 'vue-table-with-tree-grid'

//导入富文本编辑器
import VueQuillEditor from 'vue-quill-editor'

//导入富文本对应的样式
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

//导入Nprogress包对应的js和css
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'

//mock导入
import './components/mock/index.js'

//将富文本编辑器，注册为全局组件
Vue.use(VueQuillEditor)


import axios from 'axios'
axios.interceptors.request.use(config => {
  //在request拦截器中，展示进度条 NProgress.start()
  NProgress.start()
  config.headers.Authorization = window.sessionStorage.getItem('token')
  //最后必须config
  return config
})
//在response拦截器中，隐藏进度条 NProgress.start()
axios.interceptors.response.use(config =>{
  NProgress.done()
  return config
})

import {downloadRequest} from "../src/download"

Vue.prototype.$http=axios

Vue.config.productionTip = false

Vue.component('tree-table',TreeTable)

Vue.use(ElementUI); 

new Vue({
  render: h => h(App),
  //全局事件总线$bus配置
  beforeCreate() {
    Vue.prototype.$bus=this;
  },
  //注册路由
  router,
  store
}).$mount('#app')
